
//添加
function subMsg(){
    var sortName = $('#sortName').val();
	if (sortName=='') {
      alert('所填内容不能为空');
    return;
    }
    $.ajax({
        url:  urlcore + "/api/sortType/addOrUpdateSortType",
        type: "post",
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify({
            "type": 1,
            "sortName": sortName,
        }),
        dataType: "json",
        success:function(data){
            if (data.success == true) {
                    if (confirm("添加成功，是否继续添加？")) {
                        //刷新
                        location.reload();
                    } else {
                        //跳转列表页
                        window.location.href = "sorttype_list.html";
                    }
            } else if (data.code == 'OVERTIME') {
                var thisUrl = window.location.href;
                if (thisUrl.indexOf('login.html') <= -1) {
                    top.window.location.href = "login.html";
                }
            } else {
                alert(data.msg);
            }

        },
        error: function() {
            alert("error");
        }

    });
}
